package com.turing.post.organization.util;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;

import com.turing.post.util.PCPSUtil;

/**
 * 发卡商资费上下限
 * 
 * @author liun
 * @date 2013-05-27
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "ISSUEFEEPOLICYLIMIT")
@IdClass(IssueFeePolicyLimit.class)
public class IssueFeePolicyLimit implements Serializable {

	/**
	 * 01-售卡
	 */
	public static final String IFPolicy_busiType_sale = "01";
	/**
	 * 02-充值
	 */
	public static final String IFPolicy_busiType_deposit = "02";
	/**
	 * 03-赎回
	 */
	public static final String IFPolicy_busiType_redemp = "03";
	/**
	 * 12-临时挂失
	 */
	public static final String IFPolicy_busiType_temporaryLoss = "12";
	/**
	 * 04-正式挂失
	 */
	public static final String IFPolicy_busiType_loss = "04";
	/**
	 * 17-卡解挂失
	 */
	public static final String IFPolicy_busiType_relieveLoss = "17";
	/**
	 * 05-挂失换卡
	 */
	public static final String IFPolicy_busiType_changeLossCard = "05";
	/**
	 * 06-换发新卡
	 */
	public static final String IFPolicy_busiType_changeNewCard = "06";
	/**
	 * 07-卡延期
	 */
	public static final String IFPolicy_busiType_CardExpired = "07";
	/**
	 * 11-卡改密
	 */
	public static final String IFPolicy_busiType_modifyPasswd = "11";
	/**
	 * 08-重置密码
	 */
	public static final String IFPolicy_busiType_resetPasswd = "08";
	/**
	 * 09-变更卡种类
	 */
	public static final String IFPolicy_busiType_changeClassic = "09";
	/**
	 * 10-登记实名信息
	 */
	public static final String IFPolicy_busiType_realName = "10";
	/**
	 * 13-卡冻结
	 */
	public static final String IFPolicy_busiType_freeze = "13";
	/**
	 * 14-解卡冻结
	 */
	public static final String IFPolicy_busiType_freezeSolution = "14";
	/**
	 * 15-卡锁定
	 */
	public static final String IFPolicy_busiType_lock = "15";
	/**
	 * 16-解卡锁定
	 */
	public static final String IFPolicy_busiType_lockFree = "16";
	/**
	 * 18-解除卡密码锁定
	 */
	public static final String IFPolicy_busiType_pwdUnLock = "18";
	/**
	 * 30-补磁
	 */
	public static final String IFPolicy_busiType_magnetic = "30";
	/**
	 * 60-账户管理费
	 */
	public static final String IFPolicy_busiType_managementFee = "60";
	/**
	 * 61-过期管理费
	 */
	public static final String IFPolicy_busiType_expiredManagementFee = "61";

	/**
	 * 发卡商机构号
	 */
	private String issueCompanyNo;

	@Id
	@Column(name = "ISSUECOMPANYNO", nullable = false)
	public String getIssueCompanyNo() {
		return issueCompanyNo;
	}

	public void setIssueCompanyNo(String issueCompanyNo) {
		this.issueCompanyNo = issueCompanyNo;
	}

	/**
	 * 业务类型
	 */
	private String businessType;
	/**
	 * 资费上限
	 */
	private BigInteger feeUpperLimit;
	/**
	 * 资费下限
	 */
	private BigInteger feeLowerLimit;
	/**
	 * 最后修改人
	 */
	private BigInteger operID;
	/**
	 * 最后修改时间
	 */
	private Date modifyTime;
	/**
	 * 备注
	 */
	private String remark;
	
	/**
	 * 最后审核人ID
	 */
	private BigInteger lastAuthOperId;
	
	/**
	 * 最后审核时间
	 */
	private Date lastAuthTime;
	
	/**
	 * 资费上下限状态：生效待审核
	 */
	public static final String IFPOLICY_STATUS_EFFECTIVEAUDIT = "0";
	/**
	 * 资费上下限状态：生效
	 */
	public static final String IFPOLICY_STATUS_EFFECTIVE = "1";
	
	
	/**
	 * 状态
	 */
	private String status;
	
	/**
	 * 审核备注
	 */
	private String authRemark;

	@Id
	@Column(name = "BUSINESSTYPE", nullable = false)
	public String getBusinessType() {
		return businessType;
	}

	public void setBusinessType(String businessType) {
		this.businessType = businessType;
	}

	@Column(name = "REMARK", nullable = true)
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "FEEUPPERLIMIT", nullable = false)
	public BigInteger getFeeUpperLimit() {
		return feeUpperLimit;
	}

	public void setFeeUpperLimit(BigInteger feeUpperLimit) {
		this.feeUpperLimit = feeUpperLimit;
	}

	@Column(name = "FEELOWERLIMIT", nullable = false)
	public BigInteger getFeeLowerLimit() {
		return feeLowerLimit;
	}

	public void setFeeLowerLimit(BigInteger feeLowerLimit) {
		this.feeLowerLimit = feeLowerLimit;
	}

	@Column(name = "MODIFYTIME", nullable = false)
	public Date getModifyTime() {
		return modifyTime;
	}

	public void setModifyTime(Date modifyTime) {
		this.modifyTime = modifyTime;
	}

	@Column(name = "OPERID", nullable = false)
	public BigInteger getOperID() {
		return operID;
	}

	public void setOperID(BigInteger operID) {
		this.operID = operID;
	}

	@Override
	public int hashCode() {
		return PCPSUtil.getObjectListHashCode(new Object[] {
				getIssueCompanyNo(), getBusinessType() });
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof IssueFeePolicyLimit))
			return false;
		IssueFeePolicyLimit other = (IssueFeePolicyLimit) obj;
		if (!PCPSUtil.compareObject(this.getIssueCompanyNo(), other
				.getIssueCompanyNo()))
			return false;
		return PCPSUtil.compareObject(this.getBusinessType(), other
				.getBusinessType());
	}

	@Column(name = "STATUS", nullable = false)
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Column(name = "LASTAUTHOPERID", nullable = true)
	public BigInteger getLastAuthOperId() {
		return lastAuthOperId;
	}

	public void setLastAuthOperId(BigInteger lastAuthOperId) {
		this.lastAuthOperId = lastAuthOperId;
	}

	@Column(name = "LASTAUTHTIME", nullable = true)
	public Date getLastAuthTime() {
		return lastAuthTime;
	}

	public void setLastAuthTime(Date lastAuthTime) {
		this.lastAuthTime = lastAuthTime;
	}

	@Column(name = "AUTHREMARK", nullable = true)
	public String getAuthRemark() {
		return authRemark;
	}

	public void setAuthRemark(String authRemark) {
		this.authRemark = authRemark;
	}
}
